import request from '@/utils/request'

// get
export function getlist(query: any) {
  return request({
    url: '/formdata',
    method: 'get',
    params: query
  })
}
// post
export function postlist(data: any) {
  return request({
    url: '/formdata',
    method: 'post',
    data: data,
    headers: {
      isToken: false, //是否携带token
      repeatSubmit: false //接口截留关闭，只对post和put方式生效
    }
  })
}
// get 拼接
export function getid(id: string) {
  return request({
    url: '/formdata' + id,
    method: 'get'
  })
}

// put
export function putlist(data: any) {
  return request({
    url: '/formdata',
    method: 'put',
    data: data
  })
}

// delete
export function deleteid(id: string) {
  return request({
    url: '/formdata' + id,
    method: 'delete'
  })
}

//测试
export function test(data: any) {
  return request({
    url: '/api/test',
    method: 'post',
    data: data
  })
}

//测试问答
export function getContent(query: any) {
  return request({
    url: '/streamTest',
    method: 'get',
    params: query,
    responseType: 'stream' // 设置响应类型为流，以便处理大数据
  })
}
